package com.gagakuai;

import com.gagakuai.config.BeanApplicationContextIniner;
import com.gagakuai.config.TestFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class GagkuaiBusinessApplication {

    @Bean
    public TestFactoryBean testFactoryBean(){
        return  new TestFactoryBean();
    }

    public static void main(String[] args) {

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        SpringApplication application = new SpringApplication(GagkuaiBusinessApplication.class);

        application.addInitializers(new BeanApplicationContextIniner());

        application.run(args);
        //SpringApplication.run(GagkuaiBusinessApplication.class, args);
    }

}
